package com.example.sss.controller;


import com.example.sss.model.domin.Actor;
import com.example.sss.model.domin.User;
import com.example.sss.model.utils.ObsPage;
import com.example.sss.service.ActorService.ActorService;
import com.example.sss.service.UserService.UserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 王婷婷
 */
@Api(tags = "角色管理接口")
@RequestMapping("/actors")
@RestController
public class ActorController {

    @Autowired
    private ActorService actorService;


    /**
     * 查询角色列表
     * @param actor
     * @return
     */
    @RequestMapping(value="/selectActorList",method= RequestMethod.POST)
    public ObsPage selectActorList(@RequestBody Actor actor) {
        return actorService.selectActors(actor);
    }
    /**
     * 添加角色
     * @param actor
     * @return
     */
    @RequestMapping(value="/add",method= RequestMethod.POST)
    public int addActor(@RequestBody Actor actor) {
        return actorService.addActor(actor);
    }
    /**
     * 修改角色
     * @param actor
     * @return
     */
    @RequestMapping(value="/updateActor",method= RequestMethod.POST)
    public int updateActor(@RequestBody Actor actor) {
        return actorService.updateActor(actor);
    }
    /**
     * 删除角色
     * @param id
     * @return
     */
    @RequestMapping(value="/deleteActor",method= RequestMethod.POST)
    public int deleteUser(@RequestBody Integer id) {
        return actorService.deleteActor(id);
    }
}
